/*
 * This file is part of the Refran Library
 * Copyright (C) 2009 César Enrique García
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/** @file
 * $Author: cquike $
 * $Date: 2010-09-15 13:26:48 +0000 (Wed, 15 Sep 2010) $
 * $Revision: 185 $
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifndef REFRAN_ERROR_H
#define REFRAN_ERROR_H

#include <string>
#include <boost/exception/all.hpp>


namespace Refran
{


    /**
     * A class to use to throw exceptions
     */
    class Error : virtual boost::exception
    {

        public:

        /**
         * Constructor from a function and a message
         */
        Error(const std::string& function, const std::string& message);

        /**
         * Destructor
         */
        ~Error() throw();

        /**
         * Returns description of the error
         */
        const std::string what() const;

        private:

        ///Where did the error occur
        std::string m_function;

        ///Which is the error
        std::string m_message;
    };


}// namespace Refran

#endif // REFRAN_ERROR_H
